package cn.yougou.vo;

import cn.yougou.pojo.YgCart;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Arrays;

/**
 * @author: DELL
 * @date: 2021/1/4 8:53
 * @description:
 */
public class YgResOrderVo implements Serializable {
    /**
    * 用户id
    * */
    private Integer userid;
    /**
    * 手机号
    * */
    private String phone;
    /**
    * 地址
    * */
    private String address;
    /**
    * 商品数组
    * */
    private YgResCommodityVo [] ygResCommodityVos;

    /**
     * 购物车
     */
    private YgCart[] ygCarts;

    /**
    * 优惠卷id
    * */
    private Integer couponsid;

    /**
    * 商品金额
    * */
    private Double countMoney;
    /**
    * 优惠金额
    * */
    private Double grouponprice;
    /**
    * 运费
    * */
    private Double freight;
    /**
    /**
    * 实付款
    * */
    private Double actualprice;
    /**
    * 备注
    * */
    private String message;
    /**
     * 商品详情
     * */
    private String orderDate;
    /**
     * orderSn 订单编号
     * */
    private String orderSn;


    public YgResOrderVo() {
    }
    public YgResOrderVo(Integer userid,YgResCommodityVo [] ygResCommodityVos,Integer couponsid) {
    this.userid=userid;
    this.ygResCommodityVos=ygResCommodityVos;
    this.couponsid=couponsid;
    }
    public YgResOrderVo(Double grouponprice, Double actualprice,Double countMoney) {
        this.grouponprice = grouponprice;
        BigDecimal b   =   new   BigDecimal(actualprice);
        double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();
        this.actualprice = f1;
        this.countMoney = countMoney;
    }
    public YgResOrderVo(Double grouponprice, Double actualprice,Double countMoney,String orderDate) {
        this.grouponprice = grouponprice;
        BigDecimal b   =   new   BigDecimal(actualprice);
        double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();
        this.actualprice = f1;
        this.countMoney = countMoney;
        this.orderDate = orderDate;
    }

    public YgResOrderVo(Integer userid, String phone, String address, YgResCommodityVo[] ygResCommodityVos, Integer couponsid, Double countMoney, Double grouponprice, Double freight, Double actualprice, String message) {
        this.userid = userid;
        this.phone = phone;
        this.address = address;
        this.ygResCommodityVos = ygResCommodityVos;
        this.couponsid = couponsid;
        this.countMoney = countMoney;
        this.grouponprice = grouponprice;
        this.freight = freight;
        BigDecimal b   =   new   BigDecimal(actualprice);
        double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();
        this.actualprice = f1;
        this.message = message;
    }

    public YgResOrderVo(YgResCommodityVo[] ygResCommodityVo,Integer userid,Integer couponsid) {
        this.ygResCommodityVos=ygResCommodityVo;
        this.userid=userid;
        this.couponsid=couponsid;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public String getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(String orderDate) {
        this.orderDate = orderDate;
    }

    public YgCart[] getYgCarts() {
        return ygCarts;
    }

    public void setYgCarts(YgCart[] ygCarts) {
        this.ygCarts = ygCarts;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public YgResCommodityVo[] getYgResCommodityVos() {
        return ygResCommodityVos;
    }

    public void setYgResCommodityVos(YgResCommodityVo[] ygResCommodityVos) {
        this.ygResCommodityVos = ygResCommodityVos;
    }

    public Integer getCouponsid() {
        return couponsid;
    }

    public void setCouponsid(Integer couponsid) {
        this.couponsid = couponsid;
    }

    public Double getCountMoney() {
        return countMoney;
    }

    public void setCountMoney(Double countMoney) {
        this.countMoney = countMoney;
    }

    public Double getGrouponprice() {
        return grouponprice;
    }

    public void setGrouponprice(Double grouponprice) {
        this.grouponprice = grouponprice;
    }

    public Double getFreight() {
        return freight;
    }

    public void setFreight(Double freight) {
        this.freight = freight;
    }

    public Double getActualprice() {
        return actualprice;
    }

    public void setActualprice(Double actualprice) {
        this.actualprice = actualprice;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "YgResOrderVo{" +
                "userid=" + userid +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                ", ygResCommodityVos=" + Arrays.toString(ygResCommodityVos) +
                ", couponsid=" + couponsid +
                ", countMoney=" + countMoney +
                ", grouponprice=" + grouponprice +
                ", freight=" + freight +
                ", actualprice=" + actualprice +
                ", message='" + message + '\'' +
                '}';
    }
}
